package com.wpzf.ndhc.utils;

public class MyObjectUtil {


    public static Double objectIsNullToDouble(Object object) {
        Double obj;
        try {
            obj = object != null && object != "" ? Double.parseDouble(object.toString()) : 0;
        } catch (Exception ex) {
            return (double) 0;
        }
        return obj;
    }

    public static String objectIsNullToString(Object object) {
        String obj = "";
        try {
            obj = object != null ? object.toString() : "";
        } catch (Exception ex) {
            return "";
        }
        return obj;
    }

    public static Integer objectIsNullToInteger(Object object) {
        Integer obj;
        try {
            obj = object != null && object != "" ? Integer.parseInt(object.toString()) : 0;
        } catch (Exception ex) {
            return (int) 0;
        }
        return obj;
    }

}
